package com.yk.airline.dao.airline.impl;

import com.yk.airline.dao.airline.api.IAirLineDao;
import com.yk.airline.dao.common.impl.CommonDaoImpl;
import com.yk.airline.model.AirLineModel;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Project Name:airlinecrawler
 * File Name:AirLineDaoImpl
 * Package Name:com.yk.airline.dao.airlinedao.impl
 * Date:2018/1/31 10:27
 * Author:dengtianjia
 * Description:
 * Copyright (c) 2018, 重庆云凯科技有限公司 All Rights Reserved.
 */
@Repository("airLineDao")
public class AirLineDaoImpl extends CommonDaoImpl<AirLineModel> implements IAirLineDao {

    @Override
    public List<AirLineModel> findAll() {
        String hql = "from AirLineModel";
        return super.comSearchDao.findByParams(hql,null);
    }

    @Override
    public int findTotalCount() {
        String hql = "SELECT COUNT(AirLineModel.id) FROM AirLineModel";
        return super.comSearchDao.findCount(hql,null);
    }
}
